home *** CD-ROM | disk | FTP | other *** search
- Path: mail2news.demon.co.uk!genesis.demon.co.uk
- From: Lawrence Kirby <fred@genesis.demon.co.uk>
- Newsgroups: comp.lang.c
- Subject: Re: sscanf bug??????
- Date: Thu, 22 Feb 96 23:45:00 GMT
- Organization: none
- Message-ID: <825032700snz@genesis.demon.co.uk>
- References: <4fimvo$82s@fnord.dfw.net> <4fqfeo$7mh@umbc9.umbc.edu> <4gh7dc$i2@mailhub.scitec.com.au>
- Reply-To: fred@genesis.demon.co.uk
- X-NNTP-Posting-Host: genesis.demon.co.uk
- X-Newsreader: Demon Internet Simple News v1.27
- X-Mail2News-Path: genesis.demon.co.uk
-
- In article <4gh7dc$i2@mailhub.scitec.com.au>
- ramsesy@rd.scitec.com.au "Ramses Youhana" writes:
-
- >It is also good practice to specify the parameters to a function and its
- >return values. This forces an ANSI-C compiler to perform some degree of
- >parameter and return type checking, hopefully picking up some bugs at
- >compile time and saving you from lots of headaches during debugging.
- >
- >E.g.
- >
- >int main (void)
- >
- >instead of
- >
- >main()
-
- I agree that:
-
- int main(void)
-
- is by far the best way of writing this. However for complete accuracy:
-
-
- int main(void)
-
- and
-
- main(void)
-
- both specify a function that takes no arguments and returns int. Exactly
- the same amount of compiler checking is required by the C language in
- both cases.
-
- --
- -----------------------------------------
- Lawrence Kirby | fred@genesis.demon.co.uk
- Wilts, England | 70734.126@compuserve.com
- -----------------------------------------
-